package com.ysy.tz.core.selfcomp;

import javafx.scene.AccessibleAttribute;
import javafx.scene.control.ScrollBar;
import javafx.scene.control.TableView;
import javafx.scene.layout.Pane;

public class NoHeaderTableView extends CusomterTableView {
    public NoHeaderTableView() {
        this.setSelectionModel((TableView.TableViewSelectionModel)null);
    }

    public void resize(double width, double height) {
        super.resize(width, height);
        Pane header = (Pane)this.lookup("TableHeaderRow");
        header.setMinHeight(0.0);
        header.setPrefHeight(0.0);
        header.setMaxHeight(0.0);
        header.setVisible(false);
    }

    protected void layoutChildren() {
        super.layoutChildren();
        ScrollBar scrollBar = (ScrollBar)this.queryAccessibleAttribute(AccessibleAttribute.HORIZONTAL_SCROLLBAR, new Object[0]);
        if (scrollBar != null && scrollBar.isVisible()) {
            scrollBar.setPrefHeight(1.0);
            scrollBar.setMaxHeight(1.0);
            scrollBar.setOpacity(0.0);
            scrollBar.setVisible(true);
        }

        scrollBar = (ScrollBar)this.queryAccessibleAttribute(AccessibleAttribute.VERTICAL_SCROLLBAR, new Object[0]);
        if (scrollBar != null && scrollBar.isVisible()) {
            scrollBar.setPrefHeight(0.0);
            scrollBar.setMaxHeight(0.0);
            scrollBar.setOpacity(1.0);
            scrollBar.setVisible(false);
        }

    }
}
